package mediator;

/**
 * 设计模式: 中介者模式
 */
public class TestMethod {

    public static void main(String[] args) {
        ConcreteMediator m = new ConcreteMediator();
        ConcreteColleague1 c1 = new ConcreteColleague1(m);
        ConcreteColleague2 c2 = new ConcreteColleague2(m);
        m.setColleague1(c1);
        m.setColleague2(c2);

        c1.send("你吃过饭了吗,c2");
        c2.send("没有呢,你打算请客吗,c1");

    }
}
